import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/index.vue";
import Login from "../components/login/login.vue"
const routes = [

  {
    path: "/",
    name: "Login",
    component: Login,
  },

  {
    path: "/index",
    name: "HomeView",
    component: HomeView,
    children: [

      {
        path: "/actions",
        name: "actions",
        component: () =>
          import("../components/elect/action.vue"),
      },
      {
        path: "/enenger",
        name: "enenger",
        component: () =>
          import("../components/energer/enenger.vue"),
      },
      {
        path: "/userneneger",
        name: "userneneger",
        component: () =>
          import("../components/elect/userNeneger.vue"),
      },
      {
        path: "/thing",
        name: "thing",
        component: () =>
          import("../components/elect/thing.vue"),
      },
      {
        path: "/anlyenenger",
        name: "anlyenenger",
        component: () =>
          import("../components/elect/anlyenenger.vue"),
      },
      {
        path: "/pay",
        name: "pay",
        component: () =>
          import("../components/elect/pay.vue"),
      },
      {
        path: "/group",
        name: "group",
        component: () =>
          import("../components/energer/group.vue"),
      },
      {
        path: "/device",
        name: "device",
        component: () =>
          import("../components/device/device.vue"),
      }, {
        path: "/system",
        name: "system",
        component: () =>
          import("../components/count/system.vue"),
      },
      {
        path: "/role",
        name: "role",
        component: () =>
          import("../components/count/role.vue"),
      },
      {
        path: "/warning",
        name: "warning",
        component: () =>
          import("../components/count/warning.vue"),
      },
      {
        path: "/allset",
        name: "allset",
        component: () =>
          import("../components/count/allset.vue"),
      },


    ],
    redirect: '/enenger'
  },
  {
    path: "/homePage",
    name: "homePage",
    component: () =>
      import("../components/home/homePage.vue"),
  },
  {
    path: "/homePageFen",
    name: "homePageFen",
    component: () =>
      import("../components/home/homePageFen.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
